<!-- 本示例未包含完整css，获取外链css请参考上文，在hello uni-app项目中查看 -->
<template>
	<view>
		<view class="scroll_box">
			<swiper class="my-uname" circular :indicator-dots="indicatorDots" autoplay="true" interval="4000"
				duration="4000">
				<swiper-item style="margin-left: 20rpx;" v-for="(item,index) in danmuList" :key="index">
					<image :src="item.avatar"></image>
					<text class="wenzi">{{item.user_name}}开出&nbsp;{{item.type}}款&nbsp;{{item.goods_name}}</text>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	export default {
		name: "danmu",
		props: {
			danmuList: {
				type: Array,
				default () {
					return [];
				}
			}
		},
		data() {
			return {
				indicatorDots: false,
			}
		},
	}
</script>
<style scoped lang="scss">
	.my-uname {
		background: #FFFFFF;
		margin: 0rpx 1%;
		margin-left: -25rpx;
		text-align: center;
		line-height: 45rpx;
		border-radius: 10rpx;
		height: 45rpx;
		width: 100%;

		image {
			width: 35rpx;
			height: 35rpx;
			border-radius: 50%;
			opacity: 1;
			display: inline-block;
			vertical-align: middle;
			margin-top: -5rpx;
		}

		.wenzi {
			color: #666666;
			font-size: 22rpx
		}
	}
</style>
